<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var JSONP = function (url, params, callback) {
    var qs = url.indexOf('?') === -1 ? '?' : '&';
    for (let key in params)
      qs += key + '=' + params[key] + '&';
    let cbFunc = 'func';
    let cb = 'callback=' + cbFunc;
    qs += cb;
    let script = document.createElement('script');
    script.src = url + qs;
    document.body.appendChild(script);
  }

  JSONP('http://localhost:9076/jsonp', {name: 'shelley'})
  function func (param) {
    console.log(param)
  }
</script>
</body>
</html>